package myaction;

import model.User;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

/**
 * ModeDriven<T> contains the method getModel
 * 
 * @author rex
 * 
 */
public class ModelDrivenUserAction extends ActionSupport implements ModelDriven<User> {

	private User myUser;
	
	public ModelDrivenUserAction() {
		myUser = new User();
	}

	public String add() {
		System.out.println(myUser.getName());
		System.out.println(myUser.getAge());
		return SUCCESS;
	}

	public String delete() {
		return SUCCESS;
	}

	@Override
	public User getModel() {
		return myUser;
	}
}
